package com.ludomancy.insane;

import java.awt.Point;
import com.ludomancy.gamelib.entity.World;

public class Game
{
	public static Game game;
	public World world;
	public Earth earth;
	public Player player;
	
	public static final int TILE_WIDTH = 3;
	public static final int TILE_HEIGHT = 3;
	
	public Game(int width, int height)
	{
		game = this;
		world = new World(width, height, 10000, 1500);
		earth = new Earth();
		player = new Player(new Point(10,10));
		world.add(player);
		world.add(new PickAxe(new Point(9000,250)));
		world.add(new Bucket(new Point(4500,1000)));
		world.add(new Creature(new Point(1000,1000)));
		world.add(new Creature(new Point(8000,200)));
	}
	
	public void update()
	{
		earth.update();
		// iterations
		for (int i = 0; i < 20; i++)
		{
			world.update();
		}
		
	}
	
	public Point tileFor(Point point)
	{
		return new Point(point.x/TILE_WIDTH, point.y/TILE_HEIGHT);
	}
}
